import Vue from 'vue'
import request from '@/utils/request'

export function login({ userName, password, appId, endpoint }) {
  const data = {
    userName,
    password,
    appId,
    endpoint
  }
  return request({
    url: Vue.prototype.moudules.admin + '/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: Vue.prototype.moudules.admin + '/user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: Vue.prototype.moudules.admin + '/user/logout',
    method: 'post'
  })
}
